Name :Cycle left
Symbol :ROL
Illustrate:
The function of this type module is to shift the input parameter 1 "IN" to the left cyclically and the input parameter 2 "N" bits, and the result is assigned to the output parameter OUT, and the original value is still obtained after the BOOL type is cyclically shifted to any bit, when the displacement number N of the BYTE type, USINT type and SINT type exceeds 8, the operation is carried out according to N%8 (remainder), when the displacement number N of the UINT type, INT type and WORD type exceeds 16, the operation is carried out according to N%16 (remainder), when the UDINT type, If the shift number N of DINT type and DWORD type exceeds 32, N%32 (remainder) is calculated.
Image:
Parameter:
| Parameter | Statement | Type | Description |
|---|---|---|---|
| IN | Input | BOOL/BYTE/WORD/DWORD | First input value (operand) |
| N | Input | UINT | Second input value (number of left shifts) |
| OUT | Output | BOOL/BYTE/WORD/DWORD | Output value |
Example:
LD:
ST:
Interpretation:
| parameter | operand | value |
|---|---|---|
| IN | TagIn1 | 8 |
| N | TagIn2 | 10 |
| OUT | TagOut | 32 |
IN and N input the corresponding types of data, and ROL outputs the result of the cyclic left-shift operation.